package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the USERPREFDEF database table.
 * 
 */
@Embeddable
public class UserprefdefPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String classname;
	private String prefcode;

    public UserprefdefPK() {
    }

	@Column(unique=true, nullable=false, length=128)
	public String getClassname() {
		return this.classname;
	}
	public void setClassname(String classname) {
		this.classname = classname;
	}

	@Column(unique=true, nullable=false, length=30)
	public String getPrefcode() {
		return this.prefcode;
	}
	public void setPrefcode(String prefcode) {
		this.prefcode = prefcode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof UserprefdefPK)) {
			return false;
		}
		UserprefdefPK castOther = (UserprefdefPK)other;
		return 
			this.classname.equals(castOther.classname)
			&& this.prefcode.equals(castOther.prefcode);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.classname.hashCode();
		hash = hash * prime + this.prefcode.hashCode();
		
		return hash;
    }
}